/**==============================================================================
            Copyright (c) 2013 Moritz Hader, Marcel Schrder
            All Rights Reserved.

	@file  StaticElement.java

	@brief Browser intern representation of a Static Element from the IS

  This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
==============================================================================*/
package de.ibm.dhbw.backing.dataHolding;


/**
 * @author Marcel Schroeder - marcel_schroeder89@hotmail.com
 */
public class StaticElementObject extends ElementObject {
	
	//----------- Properties and Constructor -----------//

	private short status;

	public StaticElementObject(int id, int type, float IS_posX, float IS_posY, float directionX, float directionY, short status, Marker marker) {
		super(id, type, IS_posX, IS_posY, directionX, directionY, marker);
		this.status = status;
	}
	
	
	//----------- External Methods -----------//
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString() {
		String element = "StaticElement id:" + this.getId() + ", IS-Position x:" + this.getIS_posX() + "|y:" + this.getIS_posY() + ", ARB-Position x:" + this.getARB_posX() + "|y:" + this.getARB_posY() + ", MarkerId:" + this.getMarker().getId() + ", Status:" + this.status + ", Type:" + this.getType();
		return element;
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean equals(Object object) {
		if(object instanceof StaticElementObject) {
			StaticElementObject comp = (StaticElementObject) object;
			if(this.getId() == comp.getId() 
					&& this.getType() == comp.getType() 
					&& this.getIS_posX() == comp.getIS_posX() 
					&& this.getIS_posY() == comp.getIS_posY()
					&& this.status == comp.getStatus()
					&& this.getMarker().getId() == comp.getMarker().getId()) {
				return true;
			}
		}
		return false;
	}
	
	
	//----------- Simple Getter and Setter -----------//

	public short getStatus() {
		return status;
	}
}
